//
// Created by 高森森 on 2022/10/18.
//

#ifndef LEETCODE_SOLUTION_33_H
#define LEETCODE_SOLUTION_33_H
#include<bits/stdc++.h>
using namespace std;
class solution_33 {
public:
    int countSegments(string s) {
        int count=0;
        for(int i=0;i<s.size();i++){
            if((i==0||s[i-1]==' ')&&s[i]!=' '){
                count++;
            }
        }
        return count;
    }
};


#endif //LEETCODE_SOLUTION_33_H
